import request from '@/utils/request'

/**
 * 获取企业列表
 */
export const getEnterpriseListAPI = params => {
  return request({
    url: '/park/enterprise',
    method: 'GET',
    params
  })
}

/**
 * 获取企业所属行业列表
 */
export const getEnterpriseIndustryAPI = () => {
  return request({
    url: '/park/industry',
    method: 'GET'
  })
}

/**
 * 添加企业
 */
export const addEnterpriseAPI = data => {
  return request({
    url: '/park/enterprise',
    method: 'POST',
    data
  })
}

/**
 * 查看企业详情
 */
export const getEnterpriseDetailAPI = id => {
  return request({
    url: `/park/enterprise/${id}`,
    method: 'GET'
  })
}

/**
 * 编辑企业详情
 */
export const editEnterpriseDetailAPI = data => {
  return request({
    url: `/park/enterprise`,
    method: 'PUT',
    data
  })
}

/**
 * 删除企业
 */
export const deleteEnterpriseAPI = id => {
  return request({
    url: `/park/enterprise/${id}`,
    method: 'DELETE'
  })
}

/**
 * 添加、续约企业合同
 */
export const addEnterpriseRentAPI = data => {
  return request({
    url: '/park/enterprise/rent',
    method: 'POST',
    data
  })
}

/**
 * 查看单个企业租赁合同列表
 */
export const getEnterpriseRentByIdAPI = id => {
  return request({
    url: `/park/enterprise/rent/${id}`,
    method: 'GET'
  })
}

/**
 * 删除企业租赁合同
 */
export const deleteEnterpriseRentByIdAPI = id => {
  return request({
    url: `/park/enterprise/rent/${id}`,
    method: 'DELETE'
  })
}

/**
 * 退租企业租赁合同
 */
export const releaseEnterpriseRentByIdAPI = id => {
  return request({
    url: `/park/enterprise/rent/${id}`,
    method: 'PUT'
  })
}
